import request from '@/utils/request';

export const getMediaInfo = (mediaServerId: any, app: any, streamId: any) => {
  return request({
    url: '/zlm/' + mediaServerId + '/index/api/getMediaInfo?vhost=__defaultVhost__&schema=rtsp&app=' + app + '&stream=' + streamId,
    method: 'get'
  });
};
export const convertStop = (convertKey: any) => {
  return request({
    url: `/api/play/convertStop/${convertKey}`,
    method: 'post'
  });
};
export const ptzControl = (deviceId: any, channelId: any, command: any, horizonSpeed: any, verticalSpeed: any, zoomSpeed: any) => {
  return request({
    url: `/api/ptz/control/${deviceId}/${channelId}`,
    method: 'post',
    params: {
      command: command,
      horizonSpeed: horizonSpeed,
      verticalSpeed: verticalSpeed,
      zoomSpeed: zoomSpeed
    }
  });
};
export const frontEndCommand = (deviceId: any, channelId: any, cmdCode: any, groupNum: any, parameter2: any, combindCode2: any) => {
  return request({
    url: `/api/ptz/front_end_command/${deviceId}/${channelId}`,
    method: 'post',
    params: {
      cmdCode: cmdCode,
      parameter1: groupNum,
      parameter2: parameter2,
      combindCode2: combindCode2
    }
  });
};
export const broadcast = (deviceId: any, channelId: any, timeout: any, broadcastMode: any) => {
  return request({
    url: `/api/play/broadcast/${deviceId}/${channelId}`,
    method: 'get',
    params: {
      timeout: timeout,
      broadcastMode: broadcastMode
    }
  });
};
export const broadcastStop = (deviceId: any, channelId: any) => {
  return request({
    url: `/api/play/broadcast/stop/${deviceId}/${channelId}`,
    method: 'get'
  });
};
